package com.example.ruiji.utils.token;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * Author:BaiYiChen
 * Date:2022/5/2 19:29
 *
 * @author BaiYiChen
 *
 */
public class JwtToken implements AuthenticationToken {
  
  private final String access_token;
  
  /**
   * @param access_token 包装请求里携带的ACCESS_TOKEN字符串
   *@return access_token 在shiro认证时强转authenticationToken为JwtToken通过getPrincipal获取access_token字符串做鉴权
   */
  public JwtToken(String access_token) {
    this.access_token = access_token;
  }
  
  @Override
  public Object getPrincipal() {
    return access_token;
  }
  
  @Override
  public Object getCredentials() {
    return access_token;
  }
}
